<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTalentsSystemOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('talents_system_orders', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamps();
            $table->integer('user_id');
            $table->string('order_number',32);//订单号
            $table->string('goods_name',50)->nullable();//商品名称
            $table->decimal('price',8,2)->default(0);//金额
            $table->string('pay_type',20)->nullable();//支付方式
            $table->tinyInteger('pay_status')->default(0);//  0表示未支付 1表示已支付
            $table->timestamp('confirmed_at')->nullable();//支付时间
            $table->integer('month')->default(0);//购买vip月数
            $table->integer('subject_sort_id')->default(0);//购买题目分类
            $table->string('team_user_id')->nullable();//团队评估用户id 用,号分割
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('talents_system_orders');
    }
}
